<template>
	<view class="content">
		<view class="recordList" v-if="recordList&&recordList.length>0">
			<view class="recordItem" v-for="(item,index) in recordList" :key="item.id">
				<view class="top">
					申请时间 {{item.createTime}}
				</view>
				<view class="middle">
					<view class="applyNum">
						提现金额
						<view class="num">
							{{(item.transferAmount || 0)/100}}
						</view>
					</view>
					<view class="status">
						{{item.status===0?'处理中':item.status===1?'已提现':'提现失败'}}
					</view>
				</view>
				<view class="bottom">
					<view v-if="item.status===2">
						失败原因:{{item.failReason}}
					</view>
				</view>
			</view>
		</view>
		<view class="nullData" v-else>
			<image src="../../static/follow/follow1.png" mode="widthFix"></image>
			<view class="txt">
				您还没有提现记录哦~
			</view>
		</view>
	</view>
</template>

<script>
	import {
		customerTransferPage
	} from '@/api/apis.js'

	import {
		mapState,
		mapMutations
	} from "vuex";
	export default {
		data() {
			return {
				recordList: [
					// {
					// 	id: 1,
					// 	refuse: '失败原因：到账银行卡的账号有误，无法转账',
					// 	status: 0,
					// 	num: "200.00",
					// 	applyTime: '2024-04-12 12:24:48',
					// },
					// {
					// 	id: 2,
					// 	refuse: '',
					// 	status: 1,
					// 	num: "200.00",
					// 	applyTime: '2024-04-12 12:24:48',
					// },
					// {
					// 	id: 3,
					// 	refuse: '',
					// 	status: 2,
					// 	num: "200.00",
					// 	applyTime: '2024-04-12 12:24:48',
					// },
				],

			};
		},
		mounted() {
			this.onSearch()
		},
		computed: {
			...mapState("userInfo", ["Info", 'storeId']),
		},
		methods: {
			onSearch() {
				let prams = {
					customerId: this.Info.id,
					"pageNo": 1,
					"pageSize": 999
				}
				customerTransferPage(prams).then(res => {
					console.log(res);
					// return
					this.recordList = res.result.records
				})
			}
		},

	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;

		.recordList {
			padding: 25rpx;

			.recordItem {
				padding: 25rpx 0;
				border-bottom: 1px solid #D9D9D9;

				.top {
					font-size: 26rpx;
					color: #767676;
					margin-bottom: 25rpx;
				}

				.middle {
					display: flex;
					align-items: center;
					justify-content: space-between;

					.applyNum {
						display: flex;
						align-items: center;
						justify-content: flex-start;

						.num {
							margin-left: 15rpx;
							color: $uni-text-color-red;
							font-weight: bold;
						}
					}

					.status {
						color: #333333;
					}
				}

				.bottom {
					font-size: 26rpx;
					margin-top: 25rpx;
					color: $uni-text-color-red;
				}
			}
		}

		.nullData {
			width: 100%;
			margin-top: 300rpx;

			image {
				width: 35%;
				margin: 0 auto;
				display: block;
			}

			.txt {
				text-align: center;
				color: #8C8EA0;
				font-size: 30rpx;
				margin-top: 20rpx;
			}
		}
	}
</style>